package com.juitar.base.enumerator;


/**
 * @author SKopylov
 */
public class ArrayFretEnumerator
	implements IFretEnumerator {

	int[] xx;
	int ii = 0;

	public ArrayFretEnumerator(int[] array) {
		xx = array;
	}

	public ArrayFretEnumerator(Object[] array) {
		xx = new int[array.length];
		for (int i = 0; i < xx.length; i++) {
			xx[i] = ((Integer) array[i]).intValue();
		}
	}

	public boolean next() {
		ii += 1;
		return ii >= xx.length ? false : true;
	}

	public int get() {
		return xx[ii];
	}

	public void reset() {
		ii = 0;
	}
}
